//# sourceURL=role-permission-info.js


/*
 * 保存权限信息
 */
function savePermission(){
	var modules = getCheckModules();
	if(modules != ""){
		$.ajax({
			type: 'post',
			url: "admin/role/permission",
			dataType: 'json',
			data : {'roleId':$('#roleId').val(),'modules':modules},
			success: function(result){
				parent.layer.msg(result.message,{icon:1,time:2000});
				var index = parent.layer.getFrameIndex(window.name);
				parent.layer.close(index);
			},
			error:function(data) {
				console.log(data.message);
			},
		});	
	}
}

/*
 * 获取被选中的菜单
 */
function getCheckModules(){
	var modules = "";
	$('#moduleList input[type="checkbox"]:checked').each(function(){
		modules += $(this).val() + ",";
	});
	return modules;
}



